package demo2;

import org.junit.Test;

import java.io.File;
import java.io.IOException;

/**
 * @description:
 * @author:Mr.Cat
 * @create:2021-11-05 23:02
 **/
public class FileDemo {

    @Test
    public void test1()throws IOException {
        File file1 = new File("Hello.txt");
        //创建一个与file同目录下的另外一个文件，文件名为：Haha.txt
        File file2 = new File("Haha.txt");
        boolean newFile = file2.createNewFile();
        if(newFile){
            System.out.println("创建成功");
        }
    }
}

